///************************************************************************
/// <copyrigth>2018-2019 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// It is a video decoder which can automatically switch hard decoder and soft decoder 
///</describe>
/// <date>2021/6/26</date>
///***********************************************************************
#ifndef IVIDEODECODER_H
#define IVIDEODECODER_H

#include <string>

enum VideoTypeEnum
{
	// H264
	H264_VIDEO = 0,

	// H265(HEVC)
	H265_VIDEO
};

class IVideoDecoder
{
public:
	// Detructe the IVideoDecoder
	virtual ~IVideoDecoder() {	}

public:
	// Init the decoder
	virtual bool Init(VideoTypeEnum eVideoType, void* pWindowHandle = NULL) = 0;

	// Excute the decoding,note: if you set the pWindowHandle and your computer is support hard decode, then we will render the 
	// data in GPU and not return data to the pDst buffer otherwise we will fill the array of pDst for you
	virtual bool Excute(uint8_t* pSrcData,
		int iSrcSize,
		uint8_t* pDst,
		int& iDstSize,
		int& iFrameWidth,
		int& iFrameHeight) = 0;

	// Flush the decode at the last frame decoding
	virtual void Flush() = 0;
};

#endif // IVIDEODECODER_H
